/**
 * @license
 * Copyright 2018 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * =============================================================================
 */

$c-camera-capture-flash: rgb(0, 253, 36);
$c-camera-capture-bg: rgba(0, 253, 36, .4);

@keyframes flash-animation {
  from { opacity: 0 }
  to   { opacity: 1; }
}

.camera__capture-wrapper {
  width: 100%;
  height: 100%;
  position: absolute;
  overflow: hidden;
  transition: border-width .1s ease-in-out;
  z-index: 2;

  &.capture {
    border: black solid;
    border-width: 90px 30px 30px 30px;
  }

  .camera__capture-flash {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    z-index: $zindex-2--camera-flash-layer;

    &.flash {
      background: $c-camera-capture-flash;
      animation-name: flash-animation;
      animation-duration: .1s;

      &.freeze {
        mix-blend-mode: multiply;
      }
    }
  }
}

.camera__element {
  height: auto;
  left: 50%;
  min-height: 100%;
  min-width: 100%;
  overflow: hidden;
  position: absolute;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  width: auto;
  z-index: 1;

  &.camera-front-facing {
    transform: translateX(-50%) translateY(-50%) scale(-1, 1);
  }
}
